import pygame,os
from pygame.locals import *

pygame.init()

screen = pygame.display.set_mode((600,600))
pygame.display.set_caption('Hipersnake - Cristimas Snake')

class Cenario:
    def __init__(self,nome_cenario):
        self.nome = nome_cenario

        self.background = pygame.image.load('Imagens' + os.sep + 'background_fase.jpg').convert()  # carrega imagem de plano de fundo

        self.imagem_bloco1 = pygame.image.load('Imagens' + os.sep + 'bloco1.png').convert_alpha()    # return a Surface
        self.imagem_bloco2 = pygame.image.load('Imagens' + os.sep + 'bloco2.png').convert_alpha()    # return a Surface
        self.imagem_bloco3 = pygame.image.load('Imagens' + os.sep + 'bloco3.png').convert_alpha()    # return a Surface
        self.imagem_bloco4 = pygame.image.load('Imagens' + os.sep + 'bloco4.png').convert_alpha()    # return a Surface

        self.mapa_cenario1 = {self.imagem_bloco1:[(0,0),(0,30),(0,60),(0,90),(0,570),(0,540),(0,510),(0,480),
                                                  (40,570),(40,0),
                                                  (80,570),(80,0),
                                                  (120,570),(120,0),
                                                  (570,0),(530,0),
                                                  (490,0),
                                                  (450,0),
                                                  (570,30),(570,60),(570,90),(570,570),(570,540),(570,510),(570,480),
                                                  (530,570),
                                                  (450,570),
                                                  (490,570),
                                                  (160,250),(160,280),(160,310),(160,340),
                                                  (400,250),(400,280),(400,310),(400,340)]}


        self.mapa_cenario2 = {self.imagem_bloco2:[(0,0),(30,0),(60,0),(90,0),(120,0),(450,0),(480,0),(510,0),(540,0),(570,0),
                                             (0,40),(570,40),
                                             (0,80),(570,80),
                                             (0,120),(570,120),
                                             (300,150),
                                             (0,160),(570,160),
                                             (0,200),(570,200),
                                             (170,280),
                                             (430,280),
                                             (170,320),
                                             (430,320),
                                             (0,400),(570,400),
                                             (0,440),(570,440),
                                             (300,460),
                                             (0,480),(570,480),
                                             (0,520),(570,520),
                                             (0,560),(30,560),(60,560),(90,560),(120,560),(150,560),(450,560),(480,560),(510,560),(540,560),(570,560)]}


        self.mapa_cenario3 = {self.imagem_bloco3:[(0,0),(30,0),(60,0),(90,0),(120,0),(150,0),(180,0),(210,0),(240,0),(270,0),(300,0),(330,0),(360,0),(390,0),(420,0),(450,0),(480,0),(510,0),(540,0),(570,0),
                                             (0,40),(570,40),
                                             (0,80),(570,80),
                                             (0,120),(570,120),
                                             (0,150),(570,150),

                                             (280,160),
                                             (250,200),(280,200),(310,200),
                                             (150,240),(410,240),
                                             (160,280),(190,280),(380,280),(410,280),
                                             (160,310),(410,310),
                                             (250,340,),(280,340),(310,340),
                                             (280,380),

                                             (0,380),(570,380),
                                             (0,410),(570,410),
                                             (0,440),(570,440),
                                             (0,470),(570,470),
                                             (0,500),(570,500),
                                             (0,530),(570,530),
                                             (0,560),(30,560),(60,560),(90,560),(120,560),(150,560),(180,560),(210,560),(240,560),(270,560),(300,560),(330,560),(360,560),(390,560),(420,560),(450,560),(480,560),(510,560),(540,560),(570,560)]}



        self.mapa_cenario4 = {self.imagem_bloco4:[(0,0),(30,0),(60,0),(90,0),(120,0),(150,0),(180,0),(210,0),(240,0),(270,0),(300,0),(330,0),(360,0),(390,0),(420,0),(450,0),(480,0),(510,0),(540,0),(570,0),
                                             (0,30),(570,30),
                                             (0,60),(570,60),
                                             (0,90),(570,90),
                                             (0,120),(570,120),

                                             (170,150),(400,150),
                                             (170,180),(400,180),
                                             (170,210),(400,210),
                                             (170,240),(400,240),
                                             (170,270),(400,270),
                                             (170,300),(400,300),
                                             (170,330),(400,330),
                                             
                                             (0,150),(570,150),
                                             (0,180),(570,180),
                                             (0,210),(570,210),
                                             (0,240),(570,240),
                                             (0,270),(570,270),
                                             (0,300),(570,300),
                                             (0,330),(570,330),
                                             (0,360),(570,360),
                                             (0,390),(570,390),
                                             (0,420),(570,420),
                                             (0,450),(570,450),
                                             (0,480),(570,480),
                                             (0,510),(570,510),
                                             (0,540),(570,540),
                                             (0,570),(30,570),(60,570),(90,570),(120,570),(150,570),(180,570),(210,570),(240,570),(270,570),(300,570),(330,570),(360,570),(390,570),(420,570),(450,570),(480,570),(510,570),(540,570),(570,570)]}

        self.lista_cenarios = [('Cenario fase1',self.mapa_cenario1),('Cenario fase2',self.mapa_cenario2),('Cenario fase3',self.mapa_cenario3),('Cenario fase4',self.mapa_cenario4)]

    def __str__(self):
        return self.nome





